package top.moyel.hmi4k.entity

import java.util.*

class HmiRemark(
    val remark: String?,
    val defaultRemark: String?
) {
    companion object {
        fun of(remark: String?): HmiRemark? {
            if (Objects.isNull(remark) || "" == remark!!.trim()) {
                return null
            }

            val remarks = remark.split(",")
            return if (remarks.size <= 1) HmiRemark(remark, null) else HmiRemark(remarks[0], remarks[1])
        }
    }
}